package org.nepu.scr.indexrate.converter.riskrate.equipmentrisk;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.riskrate.equipmentrisk.PneumaticB22g;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class PneumaticB22gConverter implements AttributeConverter<PneumaticB22g, String> {
    @Override
    public String convertToDatabaseColumn(PneumaticB22g pneumaticB22g) {
        return JSONUtil.toJsonStr(pneumaticB22g);
    }

    @Override
    public PneumaticB22g convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, PneumaticB22g.class);
    }
}
